

class Person{

}
//TypeError: Class constructor Person cannot be invoked without 'new'
//let p = Person();
//console.log(p);

function FunctionPerson(){
    if(!(this instanceof FunctionPerson)){
        throw new Error(`TypeError: Class constructor Person cannot be invoked without 'new'`);
    }
}
let fP = FunctionPerson();
console.log(fP);